package com.example.lss.news.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.lss.news.utils.app.BaseFrament;

public class TabViewPager extends FragmentPagerAdapter {
    private String[] type;
    private BaseFrament[] baseFrament;

    public TabViewPager(FragmentManager fm, String[] type, BaseFrament[] baseFrament) {
        super(fm);
        this.type = type;
        this.baseFrament = baseFrament;
    }

    @Override
    public Fragment getItem(int position) {
        return baseFrament[position];
    }

    @Override
    public int getCount() {
        return baseFrament.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return type[position];
    }
}
